home *** CD-ROM | disk | FTP | other *** search
- Program ProfTest;
-
- {========================================================}
- {===== This code tests the ProfUnit functions. =====}
- {===== =====}
- {===== Copyright(c) 1992 Wm Potvin II =====}
- {========================================================}
-
- Uses
- ProfUnit;
-
- Var
- Test : Boolean;
- MERBuffer : ProfStr;
- TestInt : Integer;
- Index : Integer;
- MERProfileArray: StrArray;
-
-
- {***** Main Line code to test functions *****}
-
- begin
- WriteLn('Testing the WriteDOSProfileString function...');
-
- Test := WriteDOSProfileString('MARYMER',
- 'MARY',
- 'MUNCHKIN',
- 'MERTEST.INI');
-
- if NOT Test then
- WriteLn('Error writing to file...')
- else
- WriteLn('File write Ok.');
- ReadLn;
- WriteLn('Testing the GetDOSProfileString function...');
-
- TestInt := GetDosProfileString('MARYMER',
- 'MARY',
- 'nil',
- MERBuffer,
- SizeOf(MERBuffer),
- 'MERTEST.INI');
-
- WriteLn(TestInt, ' Bytes read from the buffer:');
- WriteLn(MerBuffer);
- ReadLn;
- WriteLn('Testing the ParseProfileString function...');
-
- TestInt := ParseProfileString(MERBUFFER,
- MERProfileArray);
-
- WriteLn('Contents of the buffer:');
- for Index := 0 to TestInt - 1 do
- Writeln(MERProfileArray[Index]);
- WriteLn('Done. Press <RETURN> to quit.');
- ReadLn;
-
- end.